import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import TabsPage from '../views/TabsPage.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect:  '/login', //'/home' //
  },
  {
    path: '/login',
    component: () => import('@/views/login.vue'),
  },
  {
    path: '/register',
    component: () => import('@/views/register.vue'),
  },
  {
    path: '/set',
    component: () => import('@/views/st/set.vue'),
  },
  {
    path: '/chapterPractice',
    component: () => import('@/views/st/chapterPractice.vue'),
  },
  {
    path: '/musicTheory',
    component: () => import('@/views/st/musicTheory.vue'),
  },
  {
    path: '/exam-list',
    component: () => import('@/views/information-repository/exam-list.vue'),
  },
  {
    path: '/search-list',
    component: () => import('@/views/information-repository/search-list.vue'),
  },
  {
    path: '/down-file-list',
    component: () => import('@/views/information-repository/down-file-list.vue'),
  },
  {
    path: '/flie-detail',
    component: () => import('@/views/information-repository/flie-detail.vue'),
  },
  {
    path: '/class-room-detail',
    component: () => import('@/views/class-room/class-room-detail.vue'),
  },
  {
    path: '/teacher-info',
    component: () => import('@/views/class-room/teacher-info.vue'),
  },
  {
    path: '/pay-order',
    component: () => import('@/views/class-room/pay-order.vue'),
  },
  {
    path: '/paymentresults',
    component: () => import('@/views/class-room/paymentresults.vue'),
  },
  {
    path: '/play',
    component: () => import('@/views/class-room/play.vue'),
  },
  {
    path: '/userinfo',
    component: () => import('@/views/my/userinfo.vue'),
  },
  {
    path: '/myclass',
    component: () => import('@/views/my/myclass.vue'),
  },
  {
    path: '/mycollect',
    component: () => import('@/views/my/mycollect.vue'),
  },
  {
    path: '/myct',
    component: () => import('@/views/my/myct.vue'),
  },
  {
    path: '/myset',
    component: () => import('@/views/my/myset.vue'),
  },
  {
    path: '/vip',
    component: () => import('@/views/my/vip.vue'),
  },
  {
    path: '/tabs/',
    component: TabsPage,
    children: [
      {
        path: '',
        redirect: '/tabs/homePage'
      },
      {
        path: 'homePage',
        component: () => import('@/views/st/homePage.vue')
      },
      {
        path: 'informationPepository',
        component: () => import('@/views/information-repository/information-repository.vue')
      },
      {
        path: 'classRoom',
        component: () => import('@/views/class-room/class-room.vue')
      },
      {
        path: 'myPage',
        component: () => import('@/views/my/myPage.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
